package com.yhy.tradesystem.techdata;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;

import com.yhy.tradesystem.TradeDataPak;
import com.yhy.tradesystem.TradeSystemFilter;
import com.yhy.tradesystem.TradeDataPak.TechnicalAnalysisData;

public class BaseTechDataFilter implements TradeSystemFilter {

	protected ArrayList<TradeSystemFilter> outputFilter = new ArrayList<TradeSystemFilter>();
	protected TradeDataPak pak;
	
//	protected HashMap<String, Float> parameter = new HashMap<String, Float>();
//	protected HashMap<String, Float> outputTechData = new HashMap<String, Float>();
//	
//	protected String[] parameterKeySet = {};
//	protected float[] parameterValueSet = {};
//	protected String[] techDataKeySet = {};
//	protected float[] techDataValueSet = {};
	
	
	public void setParameters(String name,float value){
			
	}
	
	public float getParameters(String name){
		return 0.0f;
	}
	
	@Override
	public void connectOutput(TradeSystemFilter filter) {
		if(filter!=null){
			outputFilter.add(filter);
		}
	}

	@Override
	public void inputData(TradeDataPak data) {
		this.pak = data;
		if(data.techDataList == null){
			data.techDataList = new ArrayList<TradeDataPak.TechnicalAnalysisData>();
		}
	}

	@Override
	public TradeDataPak outputData() {
		for(TradeSystemFilter filter:outputFilter){
			filter.inputData(pak);
		}
		return pak;
	}

	@Override
	public  String getName() {
		return BaseTechDataFilter.class.getName();
	}

	@Override
	public void resetData() {
		
	}

}
